import React from 'react'
import "babel-polyfill"
import Child from './Child'
import './index.less'
import {Button} from 'antd'


//生命周期
export default class Life extends React.PureComponent {

    constructor(props) {
        super(props);
        this.state = {
            count: 0
        };
    }
    componentDidMount() {

    }
    componentWillUnmount() {

    }
    handleAdd = () => {
        this.setState({
            count: this.state.count + 1,
        })
    }
    render() {
        return (
            <div className='content'>
                <p>React生命周期</p>
                <button onClick={this.handleAdd}>点击一下</button>
                <p>{this.state.count}</p>
                <p>子组件</p>
                <Child name={this.state.count}></Child>
                <p>antd</p>
                <Button>antd按钮</Button>
            </div>
        )
    }
}